package woshiheima13;

/**
 * 递归调用本身来完成斐波那契
 */
public class TestFebonacci {
    public static void main(String[] args) {
        //斐波那契数列  1 1 2 3 5 8
        int febonacci = Febonacci(5);
        System.out.println(febonacci);

    }
    public static int Febonacci(int f){
        if (f==1 || f==2){
            return 1;
        }else {
            return Febonacci(f-1)+Febonacci(f-2);
        }

    }
}
